package form.ui.Effect
{
	import form.utils.MathUtils;

	/** 
	 * The Fade class is a generic effect that will fade a display object.
	 */		
	public class Fade extends Interpolate 
	{
		public function Fade() { super(); }
		
		public function get opacity():Number { return this.value; }
		
		public function set startOpacity(value:Number):void { this.startValue = MathUtils.constrain(value, 0, 1); } 
		public function get startOpacity():Number { return this.startValue; }
		
		public function set stopOpacity(value:Number):void { this.stopValue = MathUtils.constrain(value, 0, 1); } 
		public function get stopOpacity():Number { return this.stopValue; }
		
		protected override function draw(interval:uint = 0):void 
		{
			if (this.target != null) { this.target.alpha = this.opacity; }
		}
	}
}